﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace WpfPdfReader
{
    /// <summary>
    /// WindowPrompt.xaml 的交互逻辑
    /// </summary>
    public partial class WindowPrompt : Window
    {
        public WindowPrompt()
        {
            InitializeComponent();
        }

        public WindowPrompt(FileItemViewModel fileItemViewModel)
            : this()
        {
            this.DataContext = fileItemViewModel;

            this.label.Text = string.Format("您上次浏览到第{0}页,内容如下，是否继续?", fileItemViewModel.Page + 1);

        }

        private void btnYes_Click(object sender, RoutedEventArgs e)
        {
            this.DialogResult = true;
            this.Close();
        }

        private void btnNo_Click(object sender, RoutedEventArgs e)
        {
            this.DialogResult = false;
            this.Close();
        }

        private void btnDetail_Click(object sender, RoutedEventArgs e)
        {
            WindowDetail win = new WindowDetail(this.DataContext as FileItemViewModel);
            win.ShowDialog();
        }

        private void btnYes_Click(object sender, MouseButtonEventArgs e)
        {
            this.DialogResult = true;
            this.Close();
        }

        private void btnNo_Click(object sender, MouseButtonEventArgs e)
        {
            this.DialogResult = false;
            this.Close();
        }

        private void btnDetail_Click(object sender, MouseButtonEventArgs e)
        {
            WindowDetail win = new WindowDetail(this.DataContext as FileItemViewModel);
            win.ShowDialog();
        }

        private void btnYes_MouseUp(object sender, MouseButtonEventArgs e)
        {
            this.DialogResult = true;
            this.Close();
        }

        private void btnNo_MouseUp(object sender, MouseButtonEventArgs e)
        {
            this.DialogResult = false;
            this.Close();
        }

        private void btnDetail_MouseUp(object sender, MouseButtonEventArgs e)
        {
            WindowDetail win = new WindowDetail(this.DataContext as FileItemViewModel);
            win.ShowDialog();
        }

    }
}
